// extern crate bindgen;
// use std::env;
// use std::path::PathBuf;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    tonic_build::compile_protos("../proto/rpc_s.proto")?;
    tonic_build::compile_protos("../proto/rpc_a.proto")?;

    // dynamic link libaudit:
    // println!("cargo:rustc-link-lib=audit");
    // let bindings = bindgen::Builder::default()
    //     .header("/usr/include/libaudit.h") // 指向libaudit头文件
    //     .generate()
    //     .expect("Unable to generate bindings");

    // let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
    // bindings
    //     .write_to_file(out_path.join("audit_bindings.rs"))
    //     .expect("Couldn't write bindings!");
    Ok(())
}
